package com.bmps.springcloud.insuredmicroservice.model.cancel;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import java.io.Serializable;
import java.util.List;

/**
 * description:
 * 结果集
 *
 * @author jackdaw
 * @date 2019-11-29 11:08
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResultListModel implements Serializable {
    private static final long serialVersionUID = -2114771243357148848L;
    @XStreamImplicit(itemFieldName ="ResultInfo")
    private List<ResultInfoModel> resultInfo;

    public List<ResultInfoModel> getResultInfo() {
        return resultInfo;
    }

    public void setResultInfo(List<ResultInfoModel> resultInfo) {
        this.resultInfo = resultInfo;
    }

    @Override
    public String toString() {
        return "ResultListModel{" +
                "resultInfo=" + resultInfo +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (!(o instanceof ResultListModel)) {
            return false;
        }

        ResultListModel that = (ResultListModel) o;

        return new EqualsBuilder()
                .append(resultInfo, that.resultInfo)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(resultInfo)
                .toHashCode();
    }
}
